'''
题目：有1、2、3、4个数字，能组成多少个互不相同且无重复数字的三位数？都是多少？
'''
import itertools
import json

import requests


def getNum():
    list = []
    for i in range(1, 5):
        for j in range(1, 5):
            for k in range(1, 5):
                if i != j and i != k and j != k:
                    num = i*100 + j*10 + k
                    list.append(num)
    return list, len(list)


if __name__ == '__main__':
    print(getNum())

    # for i in range(1, 10):
    #     for j in range(1, i + 1):
    #         print(j, '*', i, '=', i * j)
    #     print('')
    # 无限迭代器
    # 整数迭代器，起始位和步长
    # iter = itertools.count(3, 1)
    # for i in iter:
    #     if i < 10:
    #         print(i)
    iter = itertools.chain([1,2,3], [4,5])
    a = next(iter)
    print('a', a)
    print(next(iter))
    for i in iter:
        print(i)
    zushu = itertools.permutations([1, 2, 3, 4], 3)
    zushu_list = []
    num = 0
    for shu in zushu:
        zushu_list.append(shu)
        num+=1
    print(len(zushu_list), zushu_list)
    # touple1 = (1,2,3)
    # print(','.join(touple1))
    arr = [10, 3, 1, 8, 5, 2, 9]
    for i in range(len(arr)-1):
        for index in range(0, len(arr)-1):
            if arr[index] > arr[index+1]:
                arr[index], arr[index+1] = arr[index+1], arr[index]
    print(arr)

    del arr[1]
    print(arr)
    print(arr[::-1])
